package com.bdqn.controller;

import com.bdqn.pojo.User;
import com.bdqn.service.UserService;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Date;


/**
 * ExampleController
 *
 * @author LILIBO
 * @since 2022-11-30
 */
@Controller
public class ExampleController {

    @Resource
    private UserService userService;

//    @GetMapping("/hello/{id}")
//    public String hello(Model model, HttpServletRequest request, HttpSession session, @PathVariable("id") Long usrId) {
//        User user = userService.ge(usrId);
//        model.addAttribute("user", user);
//        request.setAttribute("usrPassword", user.getUsrPassword());
//        session.setAttribute("usrRoleId", user.getUsrRoleId());
//        model.addAttribute("date",new Date());
//        model.addAttribute("users",userService.list());
//        return "demo/hello";
//    }

    @GetMapping("index")
    public String index(){

        return "demo/test";
    }
}
